<template>
    <div>
        <input type="button" value="减少" @click="remove"/>
        <input type="button" value="增加" @click="add"/>
        <input type="text" v-model="$store.state.count"/>
        <hr>
        <Old></Old>
    </div>
</template>
<script>
import Old from './old.vue';
export default {
    data(){
        return {
            // count:0
        }
    },
    methods:{
        add(){
            this.$store.commit("increment");
        },
        remove(){
            this.$store.commit("subtract",{"c":1,"d":3});
        }
    },
    components:{
        Old
    }
}
</script>

